package com.example.demo.commom;

/**
 * Created with IntelliJ IDEA.
 * Description: * User:龙宝
 * Date:2023-10-11
 * Time:15:45
 */
public class MergeCode {
    public static String mergeCode(String SubmitCode,String positiveSolution) {
        int pos = SubmitCode.lastIndexOf("}");
        //没有找到{
        if(pos == -1) {
            return null;
        }
        //找到后，截取前半段
        String subSubCode = SubmitCode.substring(0,pos);
        //返回拼接的
        return subSubCode + positiveSolution + "\n}";
    }
}
